<?php
/*
**************************************************************************
*  File: escribe.php AJAX INJECTION FILE
*  (c) Extreme Portal Light Version 2010-2012
*  By elwizard. All rights reserved.
*  http://www.mgsteam.es
*
*  This program is free software under MGS License Agreement. 
*  You cannot distribute in any way. For modifications, please read 
*  MGS License Agreement for more information.
*
**************************************************************************
*/


if (isset($_GET['col1'])){ $col1 = trim($_GET['col1']); } else { $col1 = ""; }
if (isset($_GET['col2'])){ $col2 = trim($_GET['col2']); } else { $col2 = ""; }
if (isset($_GET['col3'])){ $col3 = trim($_GET['col3']); } else { $col3 = ""; }

// Quitamos los ;;;
$col1 = substr(preg_replace("#\;\;\;#is", ";", $col1), 0, -1);
$col2 = substr(preg_replace("#\;\;\;#is", ";", $col2), 0, -1);
$col3 = substr(preg_replace("#\;\;\;#is", ";", $col3), 0, -1);

// Quitamos los div apos (no nos interesan) COL izq
$tempcol1 = "";
if ($col1!="") {
	
  $tempcol = explode(";",$col1);
  
  $indice1 = 1;
  foreach ( $tempcol as $val) {
	  if (substr($val,0,1)!="a"){
		  $tempcol1 .= "$indice1,$val;";
	    $indice1++;
	  }
  }
}

// Col central
$tempcol2 = "";
if ($col2!="") {
	
  $tempcol = explode(";",$col2);
  
  $indice1 = 1;
  foreach ( $tempcol as $val) {
	  if (substr($val,0,1)!="a"){
		  $tempcol2 .= "$indice1,$val;";
	    $indice1++;
	  }
  }
}

// Col der
$tempcol3 = "";
if ($col3!="") {
	
  $tempcol = explode(";",$col3);
  
  $indice1 = 1;
  foreach ( $tempcol as $val) {
	  if (substr($val,0,1)!="a"){
		  $tempcol3 .= "$indice1,$val;";
	    $indice1++;
	  }
  }
}

// Quitamos los ;;;
$tempcol1 = substr($tempcol1, 0, -1);
$tempcol2 = substr($tempcol2, 0, -1);
$tempcol3 = substr($tempcol3, 0, -1);

echo "$tempcol1|$tempcol2|$tempcol3";

?>